<?php

class category_m_category extends a_base_model_datamapper {
  
    public function __construct($id=null) {
        $this->table = 'categories';
        $this->has_many = array(
        );
        $this->has_many['desc_m_category'] = array(
            'class' => 'desc_m_category',
            'join_other_as' => 'desc',
            'join_self_as' => 'category'
        );
        $this->has_many['association_m_category'] = array(
            'class' => 'association_m_category',
            'join_other_as' => 'association',
            'join_self_as' => 'category'
        );
        $this->has_many['products_m_category'] = array(
            'class' => 'products_m_category',
            'join_other_as' => 'products',
            'join_self_as' => 'category'
        );
        parent::__construct($id);
    }

    public function get_desc()
    {
        $cat_desc = new desc_m_category();
        return  $cat_desc->get_by_category_id($this->id);
    }
}
?>